//
//  SecondViewController.swift
//  HSMainViewControllerHandler
//
//  Created by haisheng huang on 15/12/14.
//  Copyright © 2015年 haisheng huang. All rights reserved.
//

import UIKit

class SecondViewController: UIViewController {
    
    var progress: HSGradientProgress?

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        
        progress = HSGradientProgress.create(at: self.view, frame: CGRect.init(x: 10, y: 450.0, width: self.view.frame.width - 20.0, height: 10.0), deepColor: UIColor.red, lightColor: UIColor.yellow, backgroundColor: UIColor.init(white: 0.9, alpha: 1.0), value: 0.9, isCornerRadius: true, direction: GradientChangeDirection.right, isAnimated: true, duration: 3.0)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

    class func initStoryboardViewController() -> SecondViewController {
        
        return UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "SecondViewController") as! SecondViewController
    }
    
    
    @IBAction func buttonClicked(_ sender: AnyObject) {
        
//        let fourthViewController: FourthViewController = FourthViewController.initStoryboardViewController()
//        
//        let nav = UINavigationController(rootViewController: fourthViewController)
//        
//        self.presentViewController(nav, animated: true) { () -> Void in
//            
//        }
        
       
        progress?.value = 0.6
        
        
    }
    
}
